﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class ResultWindows : MonoBehaviour {


    public Button _replayBtton;
    public Text _message;
    public MainLoop _mainLoop;

	// Use this for initialization
	void Start () {
        _replayBtton.onClick.AddListener(() => {

            gameObject.SetActive(false);
            _mainLoop.Restart();
        });
	}

    public void Show(ChessType winType)
    {
        switch (winType)
        {
            case ChessType.None:
                _message.text = "平手！";
                break;
            case ChessType.Black:
                _message.text = "恭喜战胜电脑!";
                break;
            case ChessType.White:
                _message.text = "你输了！";
                break;
            default:
                break;
        }
    }
	
	// Update is called once per frame
	void Update () {
	
	}
}
